'use strict'

module.exports = (app) => {
	const { STRING, INTEGER, DATE, BOOLEAN } = app.Sequelize

	const Categorical = app.model.define(
		'categoricals',
		{
			id: { type: INTEGER, primaryKey: true, autoIncrement: true },
			name: STRING(30),
			pid: INTEGER,
			description: STRING,
			status: {
				type: BOOLEAN,
				default: true,
			},
			remark: STRING,
			createdAt: DATE,
			updatedAt: DATE,
			deletedAt: DATE,
		},
		{
			tableName: 'categoricals', //指定表名称
			timestamps: true,
		}
	)

	return Categorical
}
